<?php

include_once("ID3.class.php");
include_once("ID3Mapper.class.php");
include_once("playlist.class.php");
include_once("playlistMapper.class.php");

session_set_cookie_params(60*10);
session_name("Music");
session_start();

if(isset($_POST["moved_song"])) {
    $playlist = PlaylistMapper::findByUseridAndName($_SESSION["userid"], $_POST["playlist_name"]);
    $id3 = ID3Mapper::findById($_POST["moved_song"]);
    $playlist[0]->add_song($id3);
    $plst = new PlaylistMapper();
    $plst->update($playlist[0]);
}

?>
